children function declared outside of any block. Cleaner code and better Firefox compatibility