Update satin.c

Major refactor