added saving of positions