Renamed some things and made some coding improvments