commented everything, removed unused stuff and fixed a few errors