added a lot more code