Tidied code. Added feature of gems following.