Did a few works

1. add reverse lookup function
2. reorganized the file structure to make it cleaner
3. fixed a few bugs