almost there.. note that type should loop