Removed unnecessary functions. Still bugs remaining!