update to cell and world code

fleshed out pseudocode, reworked some functions