Modifications after FireFart's suggestions