added pause layer, reorganize/recode some stuff