Cleaned up the code more, separated a few things from each other