reorganizing code
added TODO