Very naive and rubbish implementation!