Based on transformer optimisation chapter of book. used for deployment test purposes only.