Updated code + read me. See read me for more details.