partially implements #6, more checks to be done!