Cleaned up code

Cleaned up code. Stupid plugin still won't work for some reason though.