Added more comments. Some var changed to actual datatypes. No code changed