overhauled. check comments in code for info