moved bin definitions to new file and fixed bug