merge changes from develop branch - made some code optimisations