asert added to some functions & commented code removed