Not sure if this code is better or horrible