Writing a verry messy controller