modified use of flopmang and added tests