try using 2 different variables for length and width..
good advice is to debug it, and trace what's happening.