i just saw a normalizing the vector tutorial on the wikihow youtube and i used it to fix diagonal movement. go inside and look at the note if u want a full, not so good explanation on how to do this (make sure to read the top comment first). if you're just looking for the code then go ahead and take it but just know that the code is NOT optimized in any way shape or form. It's made so that it's easy to read and understand (for me).
arrow keys to move