corrected typing errors
corected wrong storing order
minor fixes