Comments added and code improved.