Uncleaned Working Code