reorganized methods again and added commenting