Modifed quite a few things