clean, commented and working - alpha1