Rewritten

Simpliying and reworking script