even more cleanups
Adding an untyped version, explicitly typed version and type inference via constraint solving