testing code from src. removed it to write my own