Fixed some bugs (changed variables names, spacing, etc)