commented everything and slight fixes