merged with antons changes, hopefully not overwriting anything :)