corrected code to center, and added interaction