added some old codes
renamed lib folder since they are excluded from git
Combined all other small pieces of code