added constructors and makefile
implemented flip