added variabel to configure allowed downloads
added add-function to add new codes and done some code cleanup
new way to generate codes