2D fold and energy calculations working for small sample