Added License, some bug fix and deleted old files