Attempted bugfix and added previously forgotten file