first working one-file solution