Cleaned some stuff up, added new features, seems to work as intended.