Fixed big error

Needs more tweaking tough.