Fixed bug; still needs work