Added attractive and repulsive fields, and graph creation