Added in magnet functionality