fixed early naive mistakes, and added requirements