this code was really bad.. I copy pasted it