bug fixes and fixes some test
deleted old files