Lots of changes, forgot to commit for a while!