Code reviewed. Needs to be rewriten without Amarino Libs