added code
updated first post
cleaned core