Fixed

A cleaner, working version of the previous commit