adds test and re-organises __init__