before cleanup
cleanup done, fixed major bugs