rearrange this correctly