some commented functions and bugs