New datahandling and optimalisations

Removed the database because an array is faster for this purpose