got pyramid working, try to fix nan